<html>
<head><meta charset="utf-8"><title>move error reporting · t-compiler/wg-polonius · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/index.html">t-compiler/wg-polonius</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html">move error reporting</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="205802906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205802906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205802906">(Aug 03 2020 at 14:50)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="204115">@Albin Stjerna</span></p>



<a name="205802932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205802932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205802932">(Aug 03 2020 at 14:51)</a>:</h4>
<p>hey</p>



<a name="205803150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205803150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205803150">(Aug 03 2020 at 14:52)</a>:</h4>
<p>Ok, so I started looking at how move errors work currently, and it's the same kind of "moving balls under cups" type of situation as I remember from before</p>



<a name="205803181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205803181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205803181">(Aug 03 2020 at 14:52)</a>:</h4>
<p>Various bits of data going into various data structures, etc</p>



<a name="205803182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205803182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205803182">(Aug 03 2020 at 14:52)</a>:</h4>
<p>heh</p>



<a name="205803196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205803196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205803196">(Aug 03 2020 at 14:52)</a>:</h4>
<p>yes</p>



<a name="205803218"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205803218" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205803218">(Aug 03 2020 at 14:53)</a>:</h4>
<p>But as far as I understand it, move errors are generated early, before even the Polonius facts are assembled</p>



<a name="205803224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205803224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205803224">(Aug 03 2020 at 14:53)</a>:</h4>
<p>I think at some point I was trying to keep a line so that the move error reporting largely recomputed details that it needed,</p>



<a name="205803244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205803244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205803244">(Aug 03 2020 at 14:53)</a>:</h4>
<p>partly to make polonius error reporting easier</p>



<a name="205803246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205803246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205803246">(Aug 03 2020 at 14:53)</a>:</h4>
<p>And I haven't figured out where they are actually emitted yet</p>



<a name="205803249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205803249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205803249">(Aug 03 2020 at 14:53)</a>:</h4>
<p>but that may have given way to expediency</p>



<a name="205803278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205803278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205803278">(Aug 03 2020 at 14:53)</a>:</h4>
<p>there are also perhaps a few different phases</p>



<a name="205803306"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205803306" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205803306">(Aug 03 2020 at 14:53)</a>:</h4>
<p>It seems like something like that to me</p>



<a name="205803314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205803314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205803314">(Aug 03 2020 at 14:53)</a>:</h4>
<p>i.e., I know we report <em>some</em> errors when we create "move paths", like a move of a field of a struct w/ dtor</p>



<a name="205803485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205803485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205803485">(Aug 03 2020 at 14:54)</a>:</h4>
<p>hmm</p>



<a name="205803521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205803521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205803521">(Aug 03 2020 at 14:55)</a>:</h4>
<p>I wouldn't say that was apparent from what I read</p>



<a name="205803601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205803601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205803601">(Aug 03 2020 at 14:56)</a>:</h4>
<p>I could be wrong but I'm pretty sure :)</p>



<a name="205803694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205803694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205803694">(Aug 03 2020 at 14:56)</a>:</h4>
<p>I'm loading up the code now</p>



<a name="205803969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205803969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205803969">(Aug 03 2020 at 14:58)</a>:</h4>
<p>It seems to me like the reporting happens somewhere in <code>borrow_check</code>, in the function <code>do_mir_borrowck</code>, possibly only on lines 314 and 357</p>



<a name="205804120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804120">(Aug 03 2020 at 14:59)</a>:</h4>
<p>But they accumulate earlier than that. I'm having trouble following the "promoted" errors</p>



<a name="205804262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804262">(Aug 03 2020 at 15:00)</a>:</h4>
<p>ok so</p>



<a name="205804293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804293">(Aug 03 2020 at 15:00)</a>:</h4>
<p>on line 287 you have</p>
<blockquote>
<div class="codehilite"><pre><span></span><code>    if let Err((move_data, move_errors)) = move_data_results {
</code></pre></div>


</blockquote>



<a name="205804321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804321">(Aug 03 2020 at 15:01)</a>:</h4>
<p>my memory is that the <code>move_errors</code> here refer to paths that were moved but which are not allowed to be moved</p>



<a name="205804353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804353">(Aug 03 2020 at 15:01)</a>:</h4>
<p>I guess those errors aren't <em>reported</em> yet, just gathered</p>



<a name="205804398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804398">(Aug 03 2020 at 15:01)</a>:</h4>
<p>oh, well, then there is this line (314)</p>
<blockquote>
<div class="codehilite"><pre><span></span><code>        promoted_mbcx.report_move_errors(move_errors);
</code></pre></div>


</blockquote>



<a name="205804496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804496">(Aug 03 2020 at 15:02)</a>:</h4>
<p>It seems like that, but I also think there is some recomputation done as well, on the <code>promoted_errors</code> as well?</p>



<a name="205804499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804499">(Aug 03 2020 at 15:02)</a>:</h4>
<p>but let me check I mean maybne I'm wrong :)</p>



<a name="205804550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804550">(Aug 03 2020 at 15:02)</a>:</h4>
<p>The move errors also have categories, it seems</p>



<a name="205804570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804570">(Aug 03 2020 at 15:02)</a>:</h4>
<p>well</p>



<a name="205804581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804581">(Aug 03 2020 at 15:02)</a>:</h4>
<p>we do some consolidation I thnk</p>



<a name="205804695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804695">(Aug 03 2020 at 15:03)</a>:</h4>
<p>ok I see</p>



<a name="205804702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804702">(Aug 03 2020 at 15:03)</a>:</h4>
<p>It seems the first difference is between moves out of a union or an "illegal move"</p>



<a name="205804710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804710">(Aug 03 2020 at 15:03)</a>:</h4>
<p>so the "promoted" MIR is basically inline constants</p>



<a name="205804734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804734">(Aug 03 2020 at 15:03)</a>:</h4>
<p>ah</p>



<a name="205804764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804764">(Aug 03 2020 at 15:03)</a>:</h4>
<p>so when we compile a function <code>foo</code></p>



<a name="205804794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804794">(Aug 03 2020 at 15:03)</a>:</h4>
<p>we actually create a little tree of <code>foo</code> plus any inline constants</p>



<a name="205804861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804861">(Aug 03 2020 at 15:04)</a>:</h4>
<p>these are called "promoted" because the idea is that we "promote" some expressions from runtime to compilation time</p>



<a name="205804882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804882">(Aug 03 2020 at 15:04)</a>:</h4>
<p>e.g., <code>let x = 22 + 44</code> the <code>22+44</code> would be promoted</p>



<a name="205804906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804906">(Aug 03 2020 at 15:04)</a>:</h4>
<p>you can see this because <code>let x: &amp;'static u32 = &amp;(22 + 44)</code> is legal</p>



<a name="205804933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804933">(Aug 03 2020 at 15:04)</a>:</h4>
<p>Ah, I see</p>



<a name="205804940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804940">(Aug 03 2020 at 15:04)</a>:</h4>
<p>anyway for each of those promoted expressions we have a little "attached MIR" that gets borrow checked at the same time</p>



<a name="205804983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205804983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205804983">(Aug 03 2020 at 15:05)</a>:</h4>
<p>oh ok, and we have to borrow-check them separately</p>



<a name="205805371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205805371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205805371">(Aug 03 2020 at 15:07)</a>:</h4>
<p>yeah, they are basically distinct functions</p>



<a name="205805550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205805550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205805550">(Aug 03 2020 at 15:08)</a>:</h4>
<p>anyway it looks like <code>report_move_errors</code> is <em>only</em>  reporting illegal moves</p>



<a name="205805564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205805564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205805564">(Aug 03 2020 at 15:08)</a>:</h4>
<p>do you know if we are even detecting those presently in polonius?</p>



<a name="205805636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205805636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205805636">(Aug 03 2020 at 15:09)</a>:</h4>
<p>I think the <em>other</em> errors get reported during this code:</p>
<div class="codehilite"><pre><span></span><code><span class="w">    </span><span class="n">dataflow</span>::<span class="n">visit_results</span><span class="p">(</span><span class="w"></span>
<span class="w">        </span><span class="o">&amp;</span><span class="n">body</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">traversal</span>::<span class="n">reverse_postorder</span><span class="p">(</span><span class="o">&amp;</span><span class="n">body</span><span class="p">).</span><span class="n">map</span><span class="p">(</span><span class="o">|</span><span class="p">(</span><span class="n">bb</span><span class="p">,</span><span class="w"> </span><span class="n">_</span><span class="p">)</span><span class="o">|</span><span class="w"> </span><span class="n">bb</span><span class="p">),</span><span class="w"></span>
<span class="w">        </span><span class="o">&amp;</span><span class="n">results</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="n">mbcx</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="p">);</span><span class="w"></span>
</code></pre></div>



<a name="205805653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205805653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205805653">(Aug 03 2020 at 15:09)</a>:</h4>
<p>Aah, I see</p>



<a name="205805673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205805673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205805673">(Aug 03 2020 at 15:10)</a>:</h4>
<p>that code basically walks over the control-flow graph and triggers callbacks for each statement etc</p>



<a name="205805722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205805722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205805722">(Aug 03 2020 at 15:10)</a>:</h4>
<p>at that point, the various dataflow sets are updated with the location being visited</p>



<a name="205805757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205805757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205805757">(Aug 03 2020 at 15:10)</a>:</h4>
<p>on line 573 you can see</p>
<div class="codehilite"><pre><span></span><code><span class="k">impl</span><span class="o">&lt;</span><span class="na">&#39;cx</span><span class="p">,</span><span class="w"> </span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="w"> </span><span class="n">dataflow</span>::<span class="n">ResultsVisitor</span><span class="o">&lt;</span><span class="na">&#39;cx</span><span class="p">,</span><span class="w"> </span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">MirBorrowckCtxt</span><span class="o">&lt;</span><span class="na">&#39;cx</span><span class="p">,</span><span class="w"> </span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
</code></pre></div>



<a name="205805787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205805787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205805787">(Aug 03 2020 at 15:10)</a>:</h4>
<p>which defines those callbacks</p>



<a name="205805788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205805788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205805788">(Aug 03 2020 at 15:10)</a>:</h4>
<p>for example</p>



<a name="205805792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205805792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205805792">(Aug 03 2020 at 15:10)</a>:</h4>
<div class="codehilite"><pre><span></span><code><span class="w">    </span><span class="k">fn</span> <span class="nf">visit_statement_before_primary_effect</span><span class="p">(</span><span class="w"></span>
<span class="w">        </span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="bp">self</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">flow_state</span>: <span class="kp">&amp;</span><span class="nc">Flows</span><span class="o">&lt;</span><span class="na">&#39;cx</span><span class="p">,</span><span class="w"> </span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">stmt</span>: <span class="kp">&amp;</span><span class="na">&#39;cx</span><span class="w"> </span><span class="n">Statement</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">location</span>: <span class="nc">Location</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="n">debug</span><span class="o">!</span><span class="p">(</span><span class="s">&quot;MirBorrowckCtxt::process_statement({:?}, {:?}): {:?}&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">location</span><span class="p">,</span><span class="w"> </span><span class="n">stmt</span><span class="p">,</span><span class="w"> </span><span class="n">flow_state</span><span class="p">);</span><span class="w"></span>
<span class="w">        </span><span class="kd">let</span><span class="w"> </span><span class="n">span</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">stmt</span><span class="p">.</span><span class="n">source_info</span><span class="p">.</span><span class="n">span</span><span class="p">;</span><span class="w"></span>

<span class="w">        </span><span class="bp">self</span><span class="p">.</span><span class="n">check_activations</span><span class="p">(</span><span class="n">location</span><span class="p">,</span><span class="w"> </span><span class="n">span</span><span class="p">,</span><span class="w"> </span><span class="n">flow_state</span><span class="p">);</span><span class="w"></span>

<span class="w">        </span><span class="k">match</span><span class="w"> </span><span class="o">&amp;</span><span class="n">stmt</span><span class="p">.</span><span class="n">kind</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="n">StatementKind</span>::<span class="n">Assign</span><span class="p">(</span><span class="k">box</span><span class="w"> </span><span class="p">(</span><span class="n">lhs</span><span class="p">,</span><span class="w"> </span><span class="k">ref</span><span class="w"> </span><span class="n">rhs</span><span class="p">))</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                </span><span class="bp">self</span><span class="p">.</span><span class="n">consume_rvalue</span><span class="p">(</span><span class="n">location</span><span class="p">,</span><span class="w"> </span><span class="p">(</span><span class="n">rhs</span><span class="p">,</span><span class="w"> </span><span class="n">span</span><span class="p">),</span><span class="w"> </span><span class="n">flow_state</span><span class="p">);</span><span class="w"></span>

<span class="w">                </span><span class="bp">self</span><span class="p">.</span><span class="n">mutate_place</span><span class="p">(</span><span class="n">location</span><span class="p">,</span><span class="w"> </span><span class="p">(</span><span class="o">*</span><span class="n">lhs</span><span class="p">,</span><span class="w"> </span><span class="n">span</span><span class="p">),</span><span class="w"> </span><span class="n">Shallow</span><span class="p">(</span><span class="nb">None</span><span class="p">),</span><span class="w"> </span><span class="n">JustWrite</span><span class="p">,</span><span class="w"> </span><span class="n">flow_state</span><span class="p">);</span><span class="w"></span>
<span class="w">            </span><span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="205805825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205805825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205805825">(Aug 03 2020 at 15:11)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/move.20error.20reporting/near/205805550">said</a>:</p>
<blockquote>
<p>anyway it looks like <code>report_move_errors</code> is <em>only</em>  reporting illegal moves</p>
</blockquote>
<p>No, I don't think we do, at least not unless they trigger some other kind of error</p>



<a name="205805833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205805833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205805833">(Aug 03 2020 at 15:11)</a>:</h4>
<p>this is invoked on the statement -- the name "before primary effect" means that the <code>flow_state</code> contains the values before the statement takes eeffect</p>



<a name="205805857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205805857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205805857">(Aug 03 2020 at 15:11)</a>:</h4>
<p>I also don't think we do, we should probably add this to some list of "things to think about"</p>



<a name="205805881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205805881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205805881">(Aug 03 2020 at 15:11)</a>:</h4>
<p>anyway, if you click <code>consume_rvalue</code> (say)</p>



<a name="205805922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205805922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205805922">(Aug 03 2020 at 15:12)</a>:</h4>
<div class="codehilite"><pre><span></span><code><span class="w">    </span><span class="k">fn</span> <span class="nf">consume_rvalue</span><span class="p">(</span><span class="w"></span>
<span class="w">        </span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="bp">self</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">location</span>: <span class="nc">Location</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="p">(</span><span class="n">rvalue</span><span class="p">,</span><span class="w"> </span><span class="n">span</span><span class="p">)</span>: <span class="p">(</span><span class="o">&amp;</span><span class="na">&#39;cx</span><span class="w"> </span><span class="n">Rvalue</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="p">,</span><span class="w"> </span><span class="n">Span</span><span class="p">),</span><span class="w"></span>
<span class="w">        </span><span class="n">flow_state</span>: <span class="kp">&amp;</span><span class="nc">Flows</span><span class="o">&lt;</span><span class="na">&#39;cx</span><span class="p">,</span><span class="w"> </span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
</code></pre></div>


<p>on line 1249</p>



<a name="205805958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205805958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205805958">(Aug 03 2020 at 15:12)</a>:</h4>
<p><em>it</em> will take you to <code>access_place</code></p>



<a name="205806034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205806034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205806034">(Aug 03 2020 at 15:13)</a>:</h4>
<p>the comment claims this checks the initialization state</p>



<a name="205806043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205806043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205806043">(Aug 03 2020 at 15:13)</a>:</h4>
<p>but I haven't found that code yet :)</p>



<a name="205806065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205806065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205806065">(Aug 03 2020 at 15:13)</a>:</h4>
<p>ah well</p>



<a name="205806073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205806073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205806073">(Aug 03 2020 at 15:13)</a>:</h4>
<p>Well I'm using emacs so there's no clicking</p>



<a name="205806096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205806096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205806096">(Aug 03 2020 at 15:13)</a>:</h4>
<p>rust-analyzer works with ermacs ;)</p>



<a name="205806100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205806100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205806100">(Aug 03 2020 at 15:13)</a>:</h4>
<p>but ok</p>



<a name="205806101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205806101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205806101">(Aug 03 2020 at 15:13)</a>:</h4>
<p>But I guess I really should have something with a bit better code navigation</p>



<a name="205806125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205806125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205806125">(Aug 03 2020 at 15:13)</a>:</h4>
<p>Just for...code navigation</p>



<a name="205806198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205806198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205806198">(Aug 03 2020 at 15:14)</a>:</h4>
<p>(I've converted to vscode with rust-analyzer, it's pretty nice)</p>



<a name="205806237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205806237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205806237">(Aug 03 2020 at 15:14)</a>:</h4>
<p>anyway, <code>check_access_permissions</code> does do at least <em>some</em> checking</p>



<a name="205806357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205806357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205806357">(Aug 03 2020 at 15:14)</a>:</h4>
<p>i.e., it reports an error if you assign to a non-mutable local variable <em>and</em> that variable has ever been assigned before</p>



<a name="205806406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205806406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205806406">(Aug 03 2020 at 15:15)</a>:</h4>
<p>(I'm seriously considering something like that)</p>



<a name="205806424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205806424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205806424">(Aug 03 2020 at 15:15)</a>:</h4>
<p>I guess that's probably something we left out of the rules too</p>



<a name="205806529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205806529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205806529">(Aug 03 2020 at 15:15)</a>:</h4>
<p>haha surprise</p>



<a name="205806655"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205806655" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205806655">(Aug 03 2020 at 15:16)</a>:</h4>
<p>I guess we must have, since we don't have any notion of mutability</p>



<a name="205806826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205806826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205806826">(Aug 03 2020 at 15:18)</a>:</h4>
<p><code>check_if_full_path_is_moved</code></p>



<a name="205806901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205806901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205806901">(Aug 03 2020 at 15:18)</a>:</h4>
<p>invoked from <code>check_if_path_or_subpath_is_moved</code></p>



<a name="205806939"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205806939" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205806939">(Aug 03 2020 at 15:18)</a>:</h4>
<p>invoked from <code>consume_rvalue</code></p>



<a name="205806949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205806949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205806949">(Aug 03 2020 at 15:18)</a>:</h4>
<p>I thik that the comments on <code>access_place</code> are just a bit wrong</p>



<a name="205806971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205806971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205806971">(Aug 03 2020 at 15:18)</a>:</h4>
<p>anyway, that seems to be the code that actually checks that each place expression (path) that we access is initialized</p>



<a name="205807014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205807014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205807014">(Aug 03 2020 at 15:19)</a>:</h4>
<p>if it finds that there is an access to a location that was moved, it invokes</p>



<a name="205807028"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205807028" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205807028">(Aug 03 2020 at 15:19)</a>:</h4>
<div class="codehilite"><pre><span></span><code><span class="w">            </span><span class="bp">self</span><span class="p">.</span><span class="n">report_use_of_moved_or_uninitialized</span><span class="p">(</span><span class="w"></span>
<span class="w">                </span><span class="n">location</span><span class="p">,</span><span class="w"></span>
<span class="w">                </span><span class="n">desired_action</span><span class="p">,</span><span class="w"></span>
<span class="w">                </span><span class="p">(</span><span class="n">prefix</span><span class="p">,</span><span class="w"> </span><span class="n">place_span</span><span class="p">.</span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="n">place_span</span><span class="p">.</span><span class="mi">1</span><span class="p">),</span><span class="w"></span>
<span class="w">                </span><span class="n">mpi</span><span class="p">,</span><span class="w"></span>
<span class="w">            </span><span class="p">);</span><span class="w"></span>
</code></pre></div>



<a name="205807083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205807083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205807083">(Aug 03 2020 at 15:19)</a>:</h4>
<p>so that's probably roughly speaking the code we want to try and hook into</p>



<a name="205807319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205807319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205807319">(Aug 03 2020 at 15:21)</a>:</h4>
<p>...this would have taken me <em>days</em></p>



<a name="205807808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205807808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205807808">(Aug 03 2020 at 15:26)</a>:</h4>
<p>I guess the question is how difficult it will be :)</p>



<a name="205807855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205807855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205807855">(Aug 03 2020 at 15:26)</a>:</h4>
<p>I have to go look at those arguments</p>



<a name="205807872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205807872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205807872">(Aug 03 2020 at 15:26)</a>:</h4>
<div class="codehilite"><pre><span></span><code><span class="w">    </span><span class="k">pub</span><span class="p">(</span><span class="k">in</span><span class="w"> </span><span class="k">crate</span>::<span class="n">borrow_check</span><span class="p">)</span><span class="w"> </span><span class="k">fn</span> <span class="nf">report_use_of_moved_or_uninitialized</span><span class="p">(</span><span class="w"></span>
<span class="w">        </span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="bp">self</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">location</span>: <span class="nc">Location</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="n">desired_action</span>: <span class="nc">InitializationRequiringAction</span><span class="p">,</span><span class="w"></span>
<span class="w">        </span><span class="p">(</span><span class="n">moved_place</span><span class="p">,</span><span class="w"> </span><span class="n">used_place</span><span class="p">,</span><span class="w"> </span><span class="n">span</span><span class="p">)</span>: <span class="p">(</span><span class="n">PlaceRef</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="p">,</span><span class="w"> </span><span class="n">PlaceRef</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="p">,</span><span class="w"> </span><span class="n">Span</span><span class="p">),</span><span class="w"></span>
<span class="w">        </span><span class="n">mpi</span>: <span class="nc">MovePathIndex</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
</code></pre></div>



<a name="205807922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205807922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205807922">(Aug 03 2020 at 15:26)</a>:</h4>
<p>so the <code>desired_action</code> ...</p>
<div class="codehilite"><pre><span></span><code><span class="cp">#[derive(Copy, Clone, Debug)]</span><span class="w"></span>
<span class="k">enum</span> <span class="nc">InitializationRequiringAction</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">Update</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="n">Borrow</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="n">MatchOn</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="n">Use</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="n">Assignment</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="n">PartialAssignment</span><span class="p">,</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="205807950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205807950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205807950">(Aug 03 2020 at 15:27)</a>:</h4>
<p>well, let's step back a second, what does a polonius error look like</p>



<a name="205807978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205807978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205807978">(Aug 03 2020 at 15:27)</a>:</h4>
<div class="codehilite"><pre><span></span><code>move_error(Path, TargetNode) :-
    path_maybe_uninitialized_on_exit(Path, SourceNode),
    cfg_edge(SourceNode, TargetNode),
    path_accessed_at(Path, TargetNode).
</code></pre></div>



<a name="205808084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808084">(Aug 03 2020 at 15:28)</a>:</h4>
<p>heh ok so we're missing some info to give truly <em>good</em> errors</p>



<a name="205808091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808091">(Aug 03 2020 at 15:28)</a>:</h4>
<p>but we can fake it a bit to start</p>



<a name="205808107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808107">(Aug 03 2020 at 15:28)</a>:</h4>
<p>we don't know the <em>initialization requiring action</em></p>



<a name="205808121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808121">(Aug 03 2020 at 15:28)</a>:</h4>
<p>we also don't know the <em>moved place</em></p>



<a name="205808182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808182">(Aug 03 2020 at 15:29)</a>:</h4>
<p>side note that we should <em>probably</em> change from <code>Path</code> in our nomenclature to <code>Place</code></p>



<a name="205808212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808212">(Aug 03 2020 at 15:29)</a>:</h4>
<p>even though I prefer <code>Path</code>, I think I've lost that argument and I don't care to keep arguing about it :)</p>



<a name="205808431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808431">(Aug 03 2020 at 15:31)</a>:</h4>
<p>anyway, the "moved place" is, well, the one that was moved</p>



<a name="205808439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808439">(Aug 03 2020 at 15:31)</a>:</h4>
<p>and the "used place" is the one that was used</p>



<a name="205808457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808457">(Aug 03 2020 at 15:31)</a>:</h4>
<p>but in the polonius rules as we wrote them, we kind of eagerly "expand" the set of moved places, right?</p>



<a name="205808483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808483">(Aug 03 2020 at 15:31)</a>:</h4>
<p>i.e, if you move <code>a</code> at location P, we also consider that a move of <code>a.b</code> and <code>a.c</code></p>



<a name="205808498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808498">(Aug 03 2020 at 15:31)</a>:</h4>
<p>so that by the time we get to the access, we don't know the original moved path</p>



<a name="205808506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808506">(Aug 03 2020 at 15:31)</a>:</h4>
<p>this may <em>also</em> be a source of inefficiency</p>



<a name="205808589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808589">(Aug 03 2020 at 15:32)</a>:</h4>
<p>I'm not sure, but reporting inaccurate information <em>may</em> lead to ICEs during error reporting</p>



<a name="205808591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808591">(Aug 03 2020 at 15:32)</a>:</h4>
<p>worth a try though :)</p>



<a name="205808618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808618">(Aug 03 2020 at 15:32)</a>:</h4>
<p>i.e., we could give a dummy use and use the same path for use/move place</p>



<a name="205808646"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808646" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808646">(Aug 03 2020 at 15:32)</a>:</h4>
<p>the <code>mpi</code> we ought to be able to just lookup</p>



<a name="205808650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808650">(Aug 03 2020 at 15:32)</a>:</h4>
<p>does that all make sense?</p>



<a name="205808729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808729">(Aug 03 2020 at 15:33)</a>:</h4>
<p>I guess the question then is whether we want to re-formulate the rules to track more information -- for example, we could include the <code>InitializationRequiringAction</code> in the <code>path_accessed_at</code> fact readily enough</p>



<a name="205808876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808876">(Aug 03 2020 at 15:34)</a>:</h4>
<p>the harder bit is the move-path vs used-path</p>



<a name="205808922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808922">(Aug 03 2020 at 15:34)</a>:</h4>
<p>this may be related to the errors around partial initialization, actually</p>



<a name="205808970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205808970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205808970">(Aug 03 2020 at 15:35)</a>:</h4>
<p>because I think part of what makes it hard is stuff like</p>
<ul>
<li>move the path <code>p</code></li>
<li>initialize the path <code>p.q</code></li>
</ul>



<a name="205809067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205809067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205809067">(Aug 03 2020 at 15:35)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/move.20error.20reporting/near/205808650">said</a>:</p>
<blockquote>
<p>does that all make sense?</p>
</blockquote>
<p>Yes!</p>



<a name="205809068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205809068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205809068">(Aug 03 2020 at 15:35)</a>:</h4>
<p>the current Polonius code will handle this correctly, but if you just stored the actual moves/initializations, that'd be confusing, because initializing the path <code>p.q</code> kind of "undoes" the effect of moving <code>p</code> but only partially</p>



<a name="205809214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205809214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205809214">(Aug 03 2020 at 15:36)</a>:</h4>
<p>ah</p>



<a name="205809234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205809234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205809234">(Aug 03 2020 at 15:37)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/move.20error.20reporting/near/205808729">said</a>:</p>
<blockquote>
<p>I guess the question then is whether we want to re-formulate the rules to track more information -- for example, we could include the <code>InitializationRequiringAction</code> in the <code>path_accessed_at</code> fact readily enough</p>
</blockquote>
<p>I'm not sure I follow this</p>



<a name="205809302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205809302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205809302">(Aug 03 2020 at 15:37)</a>:</h4>
<p>What is <code>InitializationRequiringAction</code>? A "tag"? Also what does it actually mean?</p>



<a name="205809484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205809484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205809484">(Aug 03 2020 at 15:39)</a>:</h4>
<p>it is used for error reporting</p>



<a name="205809492"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205809492" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205809492">(Aug 03 2020 at 15:39)</a>:</h4>
<p>it just describes the kind of thing that the code was doing</p>



<a name="205809502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205809502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205809502">(Aug 03 2020 at 15:39)</a>:</h4>
<p>so that we can report it to the user</p>



<a name="205809537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205809537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205809537">(Aug 03 2020 at 15:39)</a>:</h4>
<p>i.e., <code>match foo.bar</code> and <code>drop(foo.bar)</code> wind up getting reported slightly differently</p>



<a name="205809543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205809543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205809543">(Aug 03 2020 at 15:39)</a>:</h4>
<p>but both access <code>foo.bar</code></p>



<a name="205809556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205809556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205809556">(Aug 03 2020 at 15:39)</a>:</h4>
<p>something like that</p>



<a name="205810186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205810186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205810186">(Aug 03 2020 at 15:44)</a>:</h4>
<p>Ah, ok I see, so we would need to sort of keep that around as a label</p>



<a name="205810252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205810252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205810252">(Aug 03 2020 at 15:44)</a>:</h4>
<p>yeah</p>



<a name="205810277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205810277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205810277">(Aug 03 2020 at 15:44)</a>:</h4>
<p>one other thing is that I imagine we're going to get a lot of duplicate errors</p>



<a name="205810285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205810285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205810285">(Aug 03 2020 at 15:44)</a>:</h4>
<p>with the current propagation setup the way it is</p>



<a name="205810313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205810313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205810313">(Aug 03 2020 at 15:45)</a>:</h4>
<p>e.g., if you have something like this:</p>



<a name="205810363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205810363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205810363">(Aug 03 2020 at 15:45)</a>:</h4>
<div class="codehilite"><pre><span></span><code><span class="n">p</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">initialize</span><span class="p">();</span><span class="w"></span>
<span class="o">&amp;</span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">;</span><span class="w"></span>
<span class="o">&amp;</span><span class="n">p</span><span class="p">.</span><span class="n">y</span><span class="p">;</span><span class="w"></span>
<span class="nb">drop</span><span class="p">(</span><span class="n">p</span><span class="p">);</span><span class="w"></span>
<span class="nb">drop</span><span class="p">(</span><span class="n">p</span><span class="p">);</span><span class="w"></span>
</code></pre></div>



<a name="205810382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205810382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205810382">(Aug 03 2020 at 15:45)</a>:</h4>
<p>I think that we would create paths for <code>p.x</code> and <code>p.y</code></p>



<a name="205810400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205810400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205810400">(Aug 03 2020 at 15:45)</a>:</h4>
<p>and when we initialize <code>p</code> we will propagate forward <code>p.x</code> and <code>p.y</code></p>



<a name="205810444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205810444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205810444">(Aug 03 2020 at 15:46)</a>:</h4>
<p>but then we will expand <code>drop(p)</code> to an access of <code>p</code>, <code>p.x</code> and <code>p.y</code></p>



<a name="205810467"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205810467" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205810467">(Aug 03 2020 at 15:46)</a>:</h4>
<p>and the <em>second</em> drop will report <em>three</em> errors</p>



<a name="205810508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205810508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205810508">(Aug 03 2020 at 15:46)</a>:</h4>
<p>so maybe it really is worth thinking about reformulating the rules in a less... eager to expand sort of way</p>



<a name="205810523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205810523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205810523">(Aug 03 2020 at 15:46)</a>:</h4>
<p>this would probably also do wonders for efficiency</p>



<a name="205810770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205810770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205810770">(Aug 03 2020 at 15:48)</a>:</h4>
<p>Hm, yes, I guess so</p>



<a name="205810824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205810824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205810824">(Aug 03 2020 at 15:49)</a>:</h4>
<p>It <em>would</em> be interesting to see what that does for performance and the OOM problems</p>



<a name="205810840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205810840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205810840">(Aug 03 2020 at 15:49)</a>:</h4>
<p>Probably not much, but one can hope</p>



<a name="205810855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205810855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205810855">(Aug 03 2020 at 15:49)</a>:</h4>
<p>it'd be a lot fewer facts to propagate</p>



<a name="205810933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205810933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205810933">(Aug 03 2020 at 15:50)</a>:</h4>
<p>I think though an interesting question is what we would do about partial re-initialization</p>



<a name="205810962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205810962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205810962">(Aug 03 2020 at 15:50)</a>:</h4>
<p>I remember when we made that an error in the NLL checker, we were basically going for consistency, but we thought that probably we ultimately wanted to support it</p>



<a name="205811004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205811004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205811004">(Aug 03 2020 at 15:50)</a>:</h4>
<p>Still, I think it's ok if we take advantage of that in polonius for now :P</p>



<a name="205811089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205811089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205811089">(Aug 03 2020 at 15:51)</a>:</h4>
<p>I would think it s probably not enough to completely "change the game" when it comes to perf, that we would also want to consider adopting a basic-block-based analysis</p>



<a name="205811106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205811106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205811106">(Aug 03 2020 at 15:51)</a>:</h4>
<p>(Though one could certainly express that in datalog, whether one <em>should</em> is another question)</p>



<a name="205811249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205811249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205811249">(Aug 03 2020 at 15:52)</a>:</h4>
<p>(When it comes to perf, another interesting question that I don't know the answer to: polonius uses tuples, which are optimized for "sparse" computations. rustc uses bitsets, which are more efficient, but you pay the worst-case cost all the time. Actually I can't remember, rustc may be using sparse bitsets as a kind of hybrid)</p>



<a name="205811499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205811499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205811499">(Aug 03 2020 at 15:54)</a>:</h4>
<p>Hm</p>



<a name="205811532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205811532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205811532">(Aug 03 2020 at 15:54)</a>:</h4>
<p>reading the rules it doesn't seem like it'd be <em>that</em> hard to convert</p>



<a name="205811541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205811541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205811541">(Aug 03 2020 at 15:54)</a>:</h4>
<p>I think maybe we would need to change the rules to run initialisation "backwards"</p>



<a name="205811601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205811601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205811601">(Aug 03 2020 at 15:55)</a>:</h4>
<p>I.e. let the access propagate transitively down the move path and hit the move, rather than the other way around?</p>



<a name="205811610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205811610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205811610">(Aug 03 2020 at 15:55)</a>:</h4>
<p>so, if you assume that "partially initialization" a moved path is illegal</p>



<a name="205811641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205811641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205811641">(Aug 03 2020 at 15:55)</a>:</h4>
<p>i.e., if I move a path P, I cannot then initialize some child path of P, I must initialize P itself</p>



<a name="205811713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205811713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205811713">(Aug 03 2020 at 15:56)</a>:</h4>
<p>(or an ancestor of P, perhaps)</p>



<a name="205811746"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205811746" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205811746">(Aug 03 2020 at 15:56)</a>:</h4>
<p>these rules:</p>



<a name="205811748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205811748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205811748">(Aug 03 2020 at 15:56)</a>:</h4>
<div class="codehilite"><pre><span></span><code>path_maybe_uninitialized_on_exit(Path, Node) :-
    path_moved_at(Path, Node).

path_maybe_uninitialized_on_exit(Path, TargetNode) :-
    path_maybe_uninitialized_on_exit(Path, SourceNode),
    cfg_edge(SourceNode, TargetNode),
    !path_assigned_at(Path, TargetNode).
</code></pre></div>



<a name="205811770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205811770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205811770">(Aug 03 2020 at 15:56)</a>:</h4>
<p>if you change <code>path_moved_at</code> to <code>path_moved_at_base</code></p>



<a name="205811817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205811817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205811817">(Aug 03 2020 at 15:57)</a>:</h4>
<p>I think they "just work"</p>



<a name="205811870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205811870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205811870">(Aug 03 2020 at 15:57)</a>:</h4>
<p>it gets harder if you permit partial initialization, though not impossible, you'd have to add in some extra facts</p>



<a name="205811892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205811892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205811892">(Aug 03 2020 at 15:57)</a>:</h4>
<p>at that point, the <code>path_maybe_unitialized_on_exit</code> is a bit of a misnomer though</p>



<a name="205811897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205811897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205811897">(Aug 03 2020 at 15:57)</a>:</h4>
<p>it's kind of <code>path_maybe_moved_on_exit</code></p>



<a name="205811967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205811967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205811967">(Aug 03 2020 at 15:58)</a>:</h4>
<p>and then you need to modify the <code>move_error</code> rule to be something like</p>



<a name="205812035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812035">(Aug 03 2020 at 15:58)</a>:</h4>
<div class="codehilite"><pre><span></span><code>move_error(Path, TargetNode) :-
    path_maybe_moved_on_exit(AncestorPath, SourceNode),
    cfg_edge(SourceNode, TargetNode),
    path_accessed_at_base(Path, TargetNode), // &lt;-- changed to base
    path_ancestor(AncestorPath, Path).
</code></pre></div>



<a name="205812084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812084">(Aug 03 2020 at 15:59)</a>:</h4>
<p>maybe <code>path_maybe_directly_moved_on_exit</code> is a better name :P</p>



<a name="205812123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812123">(Aug 03 2020 at 15:59)</a>:</h4>
<p>(you would of course want to remove <code>path_assigned_at</code> entirely, also in the rules above)</p>



<a name="205812141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812141">(Aug 03 2020 at 15:59)</a>:</h4>
<p>the idea would be to only expand the relationships between paths once, independently of any node</p>



<a name="205812155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812155">(Aug 03 2020 at 15:59)</a>:</h4>
<p>ah, ok I see</p>



<a name="205812268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812268">(Aug 03 2020 at 16:00)</a>:</h4>
<p>we would do a similar thing for <code>path_maybe_initialized_on_exit</code>, I imagine...</p>



<a name="205812284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812284">(Aug 03 2020 at 16:00)</a>:</h4>
<p>is the only role of that to compute <code>var_maybe_partly_initialized_on_exit</code>?</p>



<a name="205812307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812307">(Aug 03 2020 at 16:00)</a>:</h4>
<p>it appears so</p>



<a name="205812395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812395">(Aug 03 2020 at 16:01)</a>:</h4>
<p>because surely we could do <em>that</em> more efficiently too... :)</p>



<a name="205812434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812434">(Aug 03 2020 at 16:01)</a>:</h4>
<p>but I guess that's independent, "just" an optimiztion</p>



<a name="205812454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812454">(Aug 03 2020 at 16:02)</a>:</h4>
<p>Haha</p>



<a name="205812550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812550">(Aug 03 2020 at 16:02)</a>:</h4>
<p>I wonder if I should start with the rustc connection anyway, despite knowing it will blow up, and then work on the polonius changes</p>



<a name="205812562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812562">(Aug 03 2020 at 16:02)</a>:</h4>
<p>(side note that I remember putting quite a bit of effort into hand-tuning the liveness computation in rustc, and in particular it takes advantage of the fact that "drop live" is a superset of "use live" )</p>



<a name="205812574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812574">(Aug 03 2020 at 16:03)</a>:</h4>
<p><span class="user-mention silent" data-user-id="204115">Albin Stjerna</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/move.20error.20reporting/near/205812550">said</a>:</p>
<blockquote>
<p>I wonder if I should start with the rustc connection anyway, despite knowing it will blow up, and then work on the polonius changes</p>
</blockquote>
<p>yeah I was wondering the same</p>



<a name="205812590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812590">(Aug 03 2020 at 16:03)</a>:</h4>
<p>might make sense</p>



<a name="205812598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812598">(Aug 03 2020 at 16:03)</a>:</h4>
<p>Just because that would be an easier way of running Polonius</p>



<a name="205812604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812604">(Aug 03 2020 at 16:03)</a>:</h4>
<p>it'd be nice to be able to visualize the errors</p>



<a name="205812612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812612">(Aug 03 2020 at 16:03)</a>:</h4>
<p>even if we just do it for individual tests</p>



<a name="205812617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812617">(Aug 03 2020 at 16:03)</a>:</h4>
<p>Also lets me wait for the cargo bug to be fixed</p>



<a name="205812623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812623">(Aug 03 2020 at 16:03)</a>:</h4>
<p>right</p>



<a name="205812859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812859">(Aug 03 2020 at 16:05)</a>:</h4>
<p>well I think you should be able to mock <em>something</em> up based on what I said above</p>



<a name="205812882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205812882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205812882">(Aug 03 2020 at 16:05)</a>:</h4>
<p>I'm curious if it will ICE like crazy but worth a try</p>



<a name="205814065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205814065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205814065">(Aug 03 2020 at 16:16)</a>:</h4>
<p>Yes!</p>



<a name="205818635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205818635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205818635">(Aug 03 2020 at 16:54)</a>:</h4>
<p>ah Albin in case you haven't seen it, <a href="https://github.com/rust-lang/rust/issues/70797">https://github.com/rust-lang/rust/issues/70797</a> was the issue I mentioned earlier relating to the move errors false positives, we haven't analyzed it yet but it could eventually be an interesting test for your move errors work -- and also the change that could have caused that (if it's a valid problem) was <a href="https://github.com/rust-lang/rust/pull/70546/files#diff-b05a06387184e401e73a1e9da3fdff0f">https://github.com/rust-lang/rust/pull/70546/files#diff-b05a06387184e401e73a1e9da3fdff0f</a> where path accesses were the only path fact on the start point (and maybe <em>that</em> could impact your move errors rules)</p>



<a name="205819196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205819196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205819196">(Aug 03 2020 at 16:59)</a>:</h4>
<p>Interesting, thanks!</p>



<a name="205819495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205819495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205819495">(Aug 03 2020 at 17:01)</a>:</h4>
<p>at least it's an easy revert back to its original position in case we need to do so :)</p>



<a name="205821518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205821518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205821518">(Aug 03 2020 at 17:17)</a>:</h4>
<p>oh yeah I forgot about that</p>



<a name="205821529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205821529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205821529">(Aug 03 2020 at 17:17)</a>:</h4>
<p>would be worth digging into what is going on there</p>



<a name="205852206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205852206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205852206">(Aug 03 2020 at 22:00)</a>:</h4>
<p>btw NLL rejects this case with the same error</p>



<a name="205854612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205854612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205854612">(Aug 03 2020 at 22:27)</a>:</h4>
<p>(and I would think that the error is correct because the temporary has a destructor)</p>



<a name="205854848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205854848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205854848">(Aug 03 2020 at 22:30)</a>:</h4>
<p>mm that's not clear</p>



<a name="205854898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205854898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205854898">(Aug 03 2020 at 22:31)</a>:</h4>
<p>I wonder if rewriting to <code>match</code> would make it work</p>



<a name="205854915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205854915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205854915">(Aug 03 2020 at 22:31)</a>:</h4>
<p>i.e., on the <code>None</code> path, there are no references</p>



<a name="205854922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205854922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205854922">(Aug 03 2020 at 22:31)</a>:</h4>
<p>and on the <code>Some</code> path, we move out into <code>p</code>p</p>



<a name="205855185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205855185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205855185">(Aug 03 2020 at 22:34)</a>:</h4>
<p>let's see what rewriting with a match does with polonius, as I don't think it would make a difference in NLL</p>



<a name="205855343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205855343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205855343">(Aug 03 2020 at 22:36)</a>:</h4>
<p>same error</p>



<a name="205855360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205855360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205855360">(Aug 03 2020 at 22:36)</a>:</h4>
<p>interesting in any case</p>



<a name="205856487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205856487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205856487">(Aug 03 2020 at 22:52)</a>:</h4>
<p>but I don't think it's the first time we've encountered possible imprecision with temporaries with Drop impls</p>



<a name="205888337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205888337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205888337">(Aug 04 2020 at 09:42)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/move.20error.20reporting/near/205805857">said</a>:</p>
<blockquote>
<p>I also don't think we do, we should probably add this to some list of "things to think about"</p>
</blockquote>
<p>Update: I have now <a href="https://hackmd.io/c6ooQFV-QJilsmEE15FsKQ?view#To-Think-About">added this list to the hackMD</a>.</p>



<a name="205912302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205912302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205912302">(Aug 04 2020 at 14:19)</a>:</h4>
<p>how goes <span class="user-mention" data-user-id="204115">@Albin Stjerna</span> ?</p>



<a name="205913117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205913117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205913117">(Aug 04 2020 at 14:25)</a>:</h4>
<p>Forward!</p>



<a name="205913310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205913310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205913310">(Aug 04 2020 at 14:27)</a>:</h4>
<p>I have intercepted the old logic and, I think, replaced it with something, and I'm a coffee break away from the Moment of Truth</p>



<a name="205913502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205913502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205913502">(Aug 04 2020 at 14:28)</a>:</h4>
<p>awesome !</p>



<a name="205913752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205913752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205913752">(Aug 04 2020 at 14:30)</a>:</h4>
<p>Essentially I just replace the entire <code>check_if_path_or_subpath_is_moved</code> with "unpack Polonius results"</p>



<a name="205913813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205913813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205913813">(Aug 04 2020 at 14:30)</a>:</h4>
<p>interesting</p>



<a name="205913815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205913815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205913815">(Aug 04 2020 at 14:30)</a>:</h4>
<p>That leaves the move errors we don't implement in, I think, and may possibly use the ones we have</p>



<a name="205916923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205916923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205916923">(Aug 04 2020 at 14:54)</a>:</h4>
<p>Ok, so it works for all the errors in smoke-test except this one;</p>
<div class="codehilite"><pre><span></span><code>error[E0506]: cannot assign to `*x` because it is borrowed
  --&gt; /home/albin/polonius/inputs/smoke-test/polonius-smoke-test.rs:35:9
   |
30 | pub fn position_dependent_outlives(x: &amp;mut i32, cond: bool) -&gt; &amp;mut i32 {
   |                                       - let&#39;s call the lifetime of this reference `&#39;1`
31 |     let y = &amp;mut *x;
   |             ------- borrow of `*x` occurs here
32 |     if cond {
33 |         return y;
   |                - returning this value requires that `*x` is borrowed for `&#39;1`
34 |     } else {
35 |         *x = 0;
   |         ^^^^^^ assignment to borrowed `*x` occurs here
</code></pre></div>



<a name="205917075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205917075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205917075">(Aug 04 2020 at 14:55)</a>:</h4>
<p>which is what we expect, right?</p>



<a name="205918139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205918139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205918139">(Aug 04 2020 at 15:02)</a>:</h4>
<p><span class="user-mention" data-user-id="204115">@Albin Stjerna</span> define "does not work" I guess?</p>



<a name="205918187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205918187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205918187">(Aug 04 2020 at 15:03)</a>:</h4>
<p>we don't expect an error for that test case</p>



<a name="205918191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205918191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205918191">(Aug 04 2020 at 15:03)</a>:</h4>
<p>when using polonius, anyway</p>



<a name="205918391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205918391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205918391">(Aug 04 2020 at 15:05)</a>:</h4>
<p>Exactly, that's what I meant</p>



<a name="205918414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205918414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205918414">(Aug 04 2020 at 15:05)</a>:</h4>
<p>We get the other errors as far as I can tell by eye exactly the same, including the move error</p>



<a name="205918438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205918438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205918438">(Aug 04 2020 at 15:05)</a>:</h4>
<p>So we know move error reporting works in at least one case</p>



<a name="205918454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205918454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205918454">(Aug 04 2020 at 15:05)</a>:</h4>
<p>We also know it's really using the Polonius output, because I suppressed all other output</p>



<a name="205918468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205918468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205918468">(Aug 04 2020 at 15:05)</a>:</h4>
<p>(just an early return)</p>



<a name="205918570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205918570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205918570">(Aug 04 2020 at 15:06)</a>:</h4>
<p>I'll run the tests and see what happens</p>



<a name="205918701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205918701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205918701">(Aug 04 2020 at 15:07)</a>:</h4>
<p>great</p>



<a name="205918871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205918871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205918871">(Aug 04 2020 at 15:09)</a>:</h4>
<p>Uppdate: it might have err OOM-crashed, I’m not sure because my computer is unresponsive</p>



<a name="205919131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205919131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205919131">(Aug 04 2020 at 15:11)</a>:</h4>
<p>heh</p>



<a name="205919139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205919139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205919139">(Aug 04 2020 at 15:11)</a>:</h4>
<p>uh oh</p>



<a name="205920118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205920118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205920118">(Aug 04 2020 at 15:16)</a>:</h4>
<p>It’s printing a <em>lot</em> of ^[[D:s, whatever that means</p>



<a name="205920171"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205920171" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205920171">(Aug 04 2020 at 15:17)</a>:</h4>
<p>those are rustc's tests ?</p>



<a name="205920202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205920202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205920202">(Aug 04 2020 at 15:17)</a>:</h4>
<p>Yes, in compare mode</p>



<a name="205920224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205920224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205920224">(Aug 04 2020 at 15:17)</a>:</h4>
<p>did you delete the 2 OOMing in fact gen ?</p>



<a name="205920279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205920279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205920279">(Aug 04 2020 at 15:18)</a>:</h4>
<p>Err no</p>



<a name="205920309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205920309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205920309">(Aug 04 2020 at 15:18)</a>:</h4>
<p>Ok I get a lot of failures on the ui tests</p>



<a name="205920312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205920312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205920312">(Aug 04 2020 at 15:18)</a>:</h4>
<p>could be that :)</p>



<a name="205920412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205920412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205920412">(Aug 04 2020 at 15:19)</a>:</h4>
<p>there should be around 6 or 8 failing (with possibly 2 others being slow/OOMing in move errors or somewhere, which I had to kill yesterday)</p>



<a name="205920567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205920567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205920567">(Aug 04 2020 at 15:20)</a>:</h4>
<p><span class="user-mention" data-user-id="204115">@Albin Stjerna</span> are you running with <code>--bless</code> ?</p>



<a name="205920582"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205920582" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205920582">(Aug 04 2020 at 15:20)</a>:</h4>
<p>Definitely more than that failing now, perhaps  20 or so at least</p>



<a name="205920651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205920651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205920651">(Aug 04 2020 at 15:21)</a>:</h4>
<p>I'm specifically running <code>$ ./x.py test -i --stage 1 --compare-mode polonius src/test/ui</code></p>



<a name="205920667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205920667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205920667">(Aug 04 2020 at 15:21)</a>:</h4>
<p>the good thing is that that means you hooked something up correctly</p>



<a name="205920785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205920785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205920785">(Aug 04 2020 at 15:21)</a>:</h4>
<p>and from now on you'll know for sure that it works :)</p>



<a name="205920803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205920803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205920803">(Aug 04 2020 at 15:21)</a>:</h4>
<p>Haha yes, I did something well enough to break something</p>



<a name="205920933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205920933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205920933">(Aug 04 2020 at 15:22)</a>:</h4>
<p>But more to the point, should I add <code>--bless</code> to the arguments?</p>



<a name="205921040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205921040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205921040">(Aug 04 2020 at 15:23)</a>:</h4>
<p>Also, will there be a log of the failing diffs somewhere that I can inspect?</p>



<a name="205921064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205921064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205921064">(Aug 04 2020 at 15:23)</a>:</h4>
<p>that's what blessing will do yeah</p>



<a name="205921097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205921097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205921097">(Aug 04 2020 at 15:23)</a>:</h4>
<p>you'll have .stderr files containing the changed output</p>



<a name="205921105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205921105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205921105">(Aug 04 2020 at 15:23)</a>:</h4>
<p>with <code>--bless</code> you would then use <code>git diff</code> to see what happened</p>



<a name="205921155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205921155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205921155">(Aug 04 2020 at 15:24)</a>:</h4>
<p>that will also unfortunately contain the 6-8 cases I mentioned</p>



<a name="205921237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205921237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205921237">(Aug 04 2020 at 15:24)</a>:</h4>
<p>probably best if you can avoid the OOMing tests though :)</p>



<a name="205921300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205921300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205921300">(Aug 04 2020 at 15:25)</a>:</h4>
<p>they will be annoying regardless of blessing the output</p>



<a name="205923021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205923021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205923021">(Aug 04 2020 at 15:38)</a>:</h4>
<p>modulo one or two being OOM or killed, the failures as of today, with no polonius modifications should be more or less these:</p>
<div class="codehilite"><pre><span></span><code>failures:
    [ui (polonius)] ui/closures/closure-expected-type/expect-region-supply-region-2.rs
    [ui (polonius)] ui/closures/closure-expected-type/expect-region-supply-region.rs
    [ui (polonius)] ui/hrtb/hrtb-just-for-static.rs
    [ui (polonius)] ui/hrtb/hrtb-perfect-forwarding.rs
    [ui (polonius)] ui/issues/issue-26217.rs
    [ui (polonius)] ui/issues/issue-74564-if-expr-stack-overflow.rs
    [ui (polonius)] ui/lub-glb/old-lub-glb-hr-noteq2.rs
    [ui (polonius)] ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs
</code></pre></div>



<a name="205923114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205923114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205923114">(Aug 04 2020 at 15:39)</a>:</h4>
<p>so unless there are obvious move errors differences there which I wouldn't expect, don't worry about them when you see them fail</p>



<a name="205923371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205923371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205923371">(Aug 04 2020 at 15:41)</a>:</h4>
<p>(I'd love it if we could double check our existing blessed expectations, especially the ones with differences in the number of errors, eg with closures, or maybe `static which I don't feel we handle or special-case exactly the same way)</p>



<a name="205923456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205923456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205923456">(Aug 04 2020 at 15:42)</a>:</h4>
<p>There are absolutely more errors:</p>
<div class="codehilite"><pre><span></span><code>failures:
    [ui (polonius)] ui/async-await/multiple-lifetimes/hrtb.rs
    [ui (polonius)] ui/borrowck/borrowck-asm.rs
    [ui (polonius)] ui/borrowck/borrowck-box-sensitivity.rs
    [ui (polonius)] ui/borrowck/borrowck-closures-slice-patterns-ok.rs
    [ui (polonius)] ui/borrowck/borrowck-closures-slice-patterns.rs
    [ui (polonius)] ui/borrowck/borrowck-field-sensitivity-rpass.rs
    [ui (polonius)] ui/borrowck/borrowck-field-sensitivity.rs
    [ui (polonius)] ui/borrowck/borrowck-init-in-fru.rs
    [ui (polonius)] ui/borrowck/borrowck-move-out-from-array-match.rs
    [ui (polonius)] ui/borrowck/borrowck-move-out-from-array-no-overlap-match.rs
    [ui (polonius)] ui/borrowck/borrowck-move-out-from-array-no-overlap.rs
    [ui (polonius)] ui/borrowck/borrowck-move-out-from-array-use-match.rs
    [ui (polonius)] ui/borrowck/borrowck-move-out-from-array-use-no-overlap-match.rs
    [ui (polonius)] ui/borrowck/borrowck-move-out-from-array-use-no-overlap.rs
    [ui (polonius)] ui/borrowck/borrowck-move-out-from-array-use.rs
    [ui (polonius)] ui/borrowck/borrowck-move-out-from-array.rs
    [ui (polonius)] ui/borrowck/borrowck-multiple-captures.rs
    [ui (polonius)] ui/borrowck/borrowck-partial-reinit-1.rs
    [ui (polonius)] ui/borrowck/borrowck-partial-reinit-2.rs
    [ui (polonius)] ui/borrowck/borrowck-partial-reinit-3.rs
    [ui (polonius)] ui/borrowck/borrowck-partial-reinit-4.rs
    [ui (polonius)] ui/borrowck/borrowck-uninit-field-access.rs
    [ui (polonius)] ui/borrowck/borrowck-uninit-in-assignop.rs
    [ui (polonius)] ui/borrowck/borrowck-uninit-ref-chain.rs
    [ui (polonius)] ui/borrowck/borrowck-union-move-assign.rs
    [ui (polonius)] ui/borrowck/borrowck-union-move.rs
    [ui (polonius)] ui/borrowck/borrowck-use-in-index-lvalue.rs
    [ui (polonius)] ui/borrowck/borrowck-use-uninitialized-in-cast-trait.rs
    [ui (polonius)] ui/borrowck/borrowck-use-uninitialized-in-cast.rs
    [ui (polonius)] ui/closures/closure-expected-type/expect-region-supply-region-2.rs
    [ui (polonius)] ui/closures/closure-expected-type/expect-region-supply-region.rs
    [ui (polonius)] ui/drop/dynamic-drop-async.rs
    [ui (polonius)] ui/hrtb/hrtb-just-for-static.rs
    [ui (polonius)] ui/hrtb/hrtb-perfect-forwarding.rs
    [ui (polonius)] ui/ifmt.rs
    [ui (polonius)] ui/intrinsics/intrinsics-integer.rs
    [ui (polonius)] ui/issues/issue-17263.rs
    [ui (polonius)] ui/issues/issue-17385.rs
    [ui (polonius)] ui/issues/issue-19340-2.rs
    [ui (polonius)] ui/issues/issue-26217.rs
    [ui (polonius)] ui/issues/issue-2718.rs
    [ui (polonius)] ui/issues/issue-27282-move-match-input-into-guard.rs
    [ui (polonius)] ui/issues/issue-29166.rs
    [ui (polonius)] ui/issues/issue-3609.rs
    [ui (polonius)] ui/issues/issue-42679.rs
    [ui (polonius)] ui/issues/issue-74564-if-expr-stack-overflow.rs
    [ui (polonius)] ui/liveness/liveness-use-after-move.rs
    [ui (polonius)] ui/lub-glb/old-lub-glb-hr-noteq2.rs
    [ui (polonius)] ui/moves/moves-sru-moved-field.rs
    [ui (polonius)] ui/mpsc_stress.rs
    [ui (polonius)] ui/nll/issue-21232-partial-init-and-erroneous-use.rs
    [ui (polonius)] ui/nll/issue-48623-closure.rs
    [ui (polonius)] ui/nll/issue-48623-generator.rs
    [ui (polonius)] ui/nll/issue-51512.rs
    [ui (polonius)] ui/nll/user-annotations/patterns.rs
    [ui (polonius)] ui/numbers-arithmetic/saturating-float-casts.rs
    [ui (polonius)] ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.rs
    [ui (polonius)] ui/pattern/move-ref-patterns/feature-gate-move_ref_pattern.rs
    [ui (polonius)] ui/pattern/move-ref-patterns/issue-53840.rs
    [ui (polonius)] ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-inside.rs
    [ui (polonius)] ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures-pass.rs
    [ui (polonius)] ui/pattern/move-ref-patterns/move-ref-patterns-dynamic-semantics.rs
    [ui (polonius)] ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs
    [ui (polonius)] ui/resource-assign-is-not-copy.rs
    [ui (polonius)] ui/self/elision/alias-async.rs
    [ui (polonius)] ui/self/elision/assoc-async.rs
    [ui (polonius)] ui/self/elision/lt-alias-async.rs
    [ui (polonius)] ui/self/elision/lt-assoc-async.rs
    [ui (polonius)] ui/self/elision/lt-ref-self-async.rs
    [ui (polonius)] ui/self/elision/lt-self-async.rs
    [ui (polonius)] ui/self/elision/lt-struct-async.rs
    [ui (polonius)] ui/self/elision/multiple-ref-self-async.rs
    [ui (polonius)] ui/self/elision/ref-alias-async.rs
    [ui (polonius)] ui/self/elision/ref-assoc-async.rs
    [ui (polonius)] ui/self/elision/ref-mut-alias-async.rs
    [ui (polonius)] ui/self/elision/ref-mut-self-async.rs
    [ui (polonius)] ui/self/elision/ref-mut-struct-async.rs
    [ui (polonius)] ui/self/elision/ref-self-async.rs
    [ui (polonius)] ui/self/elision/ref-struct-async.rs
    [ui (polonius)] ui/self/elision/self-async.rs
    [ui (polonius)] ui/self/elision/struct-async.rs
    [ui (polonius)] ui/threads-sendsync/send_str_treemap.rs
    [ui (polonius)] ui/traits/trait-bounds-in-arc.rs
    [ui (polonius)] ui/type-alias-impl-trait/type-alias-impl-trait-tuple.rs
    [ui (polonius)] ui/unboxed-closures/unboxed-closures-move-some-upvars-in-by-ref-closure.rs
    [ui (polonius)] ui/union/union-borrow-move-parent-sibling.rs
    [ui (polonius)] ui/use/use-after-move-self-based-on-type.rs
    [ui (polonius)] ui/use/use-after-move-self.rs
    [ui (polonius)] ui/walk-struct-literal-with.rs
    [ui (polonius)] ui/wrapping-int-combinations.rs

test result: FAILED. 10380 passed; 90 failed; 72 ignored; 0 measured; 0 filtered out
</code></pre></div>



<a name="205923502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205923502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205923502">(Aug 04 2020 at 15:42)</a>:</h4>
<p>I'll try again with --bless and see what the differences are</p>



<a name="205923525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205923525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205923525">(Aug 04 2020 at 15:42)</a>:</h4>
<p>ui/numbers-arithmetic/saturating-float-casts.rs and ui/wrapping-int-combinations.rs are the 2 known OOMs</p>



<a name="205923792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205923792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205923792">(Aug 04 2020 at 15:45)</a>:</h4>
<p>the ones in ui/borrowck/ about moves and partial reinits should be interesting</p>



<a name="205923952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205923952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205923952">(Aug 04 2020 at 15:47)</a>:</h4>
<p>It seems we get some spurious errors I assume to be the same</p>



<a name="205924212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205924212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205924212">(Aug 04 2020 at 15:49)</a>:</h4>
<p>how so ?</p>



<a name="205924339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205924339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205924339">(Aug 04 2020 at 15:50)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error[E0382]: use of moved value: `f`
  --&gt; /home/albin/rust/src/test/ui/self/elision/lt-alias-async.rs:13:30
   |
LL |     async fn take_self(self, f: &amp;u32) -&gt; &amp;u32 {
   |                        ----  ^ value used here after move
   |                        |
   |                        value moved here
   |
   = note: move occurs because `self` has type `Struct&lt;&#39;_&gt;`, which does not implement the `Copy` trait
</code></pre></div>



<a name="205924394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205924394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205924394">(Aug 04 2020 at 15:51)</a>:</h4>
<p>This...makes no sense, the code looks like this:</p>
<div class="codehilite"><pre><span></span><code>    async fn take_self(self, f: &amp;u32) -&gt; &amp;u32 {
        f
    }
</code></pre></div>



<a name="205924419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205924419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205924419">(Aug 04 2020 at 15:51)</a>:</h4>
<p><code>self</code> and <code>f</code> aren't even related in any way</p>



<a name="205924971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205924971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205924971">(Aug 04 2020 at 15:56)</a>:</h4>
<p>I do wonder whether the way async fns are desugared can be special wrt to self ...</p>



<a name="205927139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205927139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205927139">(Aug 04 2020 at 16:14)</a>:</h4>
<p>I'll investigate more later. I'm still chalking this up as a partial success!</p>



<a name="205927319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205927319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205927319">(Aug 04 2020 at 16:15)</a>:</h4>
<p>it definitely is a success !</p>



<a name="205927459"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205927459" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205927459">(Aug 04 2020 at 16:16)</a>:</h4>
<p>great job already :)</p>



<a name="205927679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205927679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205927679">(Aug 04 2020 at 16:18)</a>:</h4>
<p>Thanks!</p>



<a name="205928562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205928562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205928562">(Aug 04 2020 at 16:26)</a>:</h4>
<p>that's great -- those errors <em>do</em> look like nonsense but I imagine it has something to do with how we're faking the data</p>



<a name="205928571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205928571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205928571">(Aug 04 2020 at 16:27)</a>:</h4>
<p>push the branch somewhere, <span class="user-mention" data-user-id="204115">@Albin Stjerna</span> ?</p>



<a name="205939025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205939025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205939025">(Aug 04 2020 at 18:01)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/move.20error.20reporting/near/205928571">said</a>:</p>
<blockquote>
<p>push the branch somewhere, <span class="user-mention silent" data-user-id="204115">Albin Stjerna</span> ?</p>
</blockquote>
<p>Sorry, I was making dinner. It's already at my fork, <a href="https://github.com/albins/rust">https://github.com/albins/rust</a></p>



<a name="205939102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205939102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205939102">(Aug 04 2020 at 18:02)</a>:</h4>
<p>Should I already open a WIP pull request against Rust?</p>



<a name="205955067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205955067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205955067">(Aug 04 2020 at 20:17)</a>:</h4>
<p>niko had asked yesterday if we had a rundown of the move errors computation slowness, and I do now, on <code>clap</code> which takes 100-110s:</p>
<ul>
<li>70-80s are spent on uninit <a href="https://github.com/rust-lang/polonius/blob/master/polonius-engine/src/output/initialization.rs#L176-L183">in this rule</a></li>
<li>20-30s are spent on <a href="https://github.com/rust-lang/polonius/blob/master/polonius-engine/src/output/initialization.rs#L198-L206">the move errors rule</a></li>
<li>the <code>compute_transitive_paths</code> is fast compared to the other two, if I comment those two, so compute only the maybe init required for liveness, it's around 450ms for the whole initialization parts of the pipeline</li>
</ul>



<a name="205964253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205964253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205964253">(Aug 04 2020 at 21:39)</a>:</h4>
<p>I think we can speedup that rule some more, too</p>



<a name="205964584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205964584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205964584">(Aug 04 2020 at 21:42)</a>:</h4>
<p>seems likely</p>



<a name="205996040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205996040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205996040">(Aug 05 2020 at 07:42)</a>:</h4>
<p>I'll spend today working on diagnosing the errors in the ui tests I saw yesterday, trying to figure out what goes wrong</p>



<a name="205996189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/205996189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#205996189">(Aug 05 2020 at 07:45)</a>:</h4>
<p>(maybe also do a quick location flipping of the access fact just in case ;)</p>



<a name="206002213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206002213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206002213">(Aug 05 2020 at 09:12)</a>:</h4>
<p>beautiful v2.0 :D <a href="/user_uploads/4715/hO95MovzXx0soVy8Dhg7YNH2/image.png">tracy_profile.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/hO95MovzXx0soVy8Dhg7YNH2/image.png" title="tracy_profile.png"><img src="/user_uploads/4715/hO95MovzXx0soVy8Dhg7YNH2/image.png"></a></div>



<a name="206003334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206003334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206003334">(Aug 05 2020 at 09:28)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> wait, what is that?</p>



<a name="206003340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206003340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206003340">(Aug 05 2020 at 09:28)</a>:</h4>
<p>looks slick</p>



<a name="206003378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206003378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206003378">(Aug 05 2020 at 09:29)</a>:</h4>
<p>it's <a href="https://github.com/wolfpld/tracy">https://github.com/wolfpld/tracy</a> :)</p>



<a name="206003465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206003465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206003465">(Aug 05 2020 at 09:30)</a>:</h4>
<p>it's very slick indeed, better on windows rn as it mixes manual instrumentation and sampling</p>



<a name="206003543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206003543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206003543">(Aug 05 2020 at 09:31)</a>:</h4>
<p>nice...</p>



<a name="206003558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206003558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206003558">(Aug 05 2020 at 09:31)</a>:</h4>
<p>maybe for once I might have a reason to develop on windows</p>



<a name="206003633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206003633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206003633">(Aug 05 2020 at 09:32)</a>:</h4>
<p>on linux it "just" does the manual instrumentation</p>



<a name="206003659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206003659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206003659">(Aug 05 2020 at 09:32)</a>:</h4>
<p>so it's -Zself-profile like, with aggregation, querying, graphical views, comparisons between profile runs (!) etc etc</p>



<a name="206003678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206003678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206003678">(Aug 05 2020 at 09:33)</a>:</h4>
<p>of course it works within rustc as well</p>



<a name="206003706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206003706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206003706">(Aug 05 2020 at 09:33)</a>:</h4>
<p>(I've posted some more screenshots of rustc integration before <a href="#narrow/stream/187831-t-compiler.2Fwg-self-profile/topic/tracy">here</a> where I just mimicked the -Zself-profile events, and an example of the sampling on polonius in <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/general/near/206000707">this other screenshot</a>)</p>



<a name="206004074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206004074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206004074">(Aug 05 2020 at 09:39)</a>:</h4>
<p>(there also was the recent <a href="https://github.com/bombomby/optick-rs">https://github.com/bombomby/optick-rs</a> but this one's GUI only works on windows (data collection is system-independent), while Tracy's works everywhere)</p>



<a name="206004487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206004487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206004487">(Aug 05 2020 at 09:46)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116113">lqd</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/move.20error.20reporting/near/205996189">said</a>:</p>
<blockquote>
<p>(maybe also do a quick location flipping of the access fact just in case ;)</p>
</blockquote>
<p>Remind me, was it that we moved the access event from start-point to mid-point?</p>



<a name="206005207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206005207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206005207">(Aug 05 2020 at 09:56)</a>:</h4>
<p>it caused move errors false positives on the datasets inside the repo</p>



<a name="206005229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206005229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206005229">(Aug 05 2020 at 09:57)</a>:</h4>
<p>some things were initialized or uninit and across blocks the event and the move error were at the same point</p>



<a name="206005262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206005262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206005262">(Aug 05 2020 at 09:57)</a>:</h4>
<p>my investigation into that was <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/move.20errors/near/191031867">https://rust-lang.zulipchat.com/#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/move.20errors/near/191031867</a></p>



<a name="206005354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206005354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206005354">(Aug 05 2020 at 09:58)</a>:</h4>
<p>it seemed to make sense, but at the same time likely caused <a href="https://github.com/rust-lang/rust/issues/70797">https://github.com/rust-lang/rust/issues/70797</a> which we still don't exactly know for sure what's going on there</p>



<a name="206029215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206029215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206029215">(Aug 05 2020 at 14:34)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116113">lqd</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/move.20error.20reporting/near/205996189">said</a>:</p>
<blockquote>
<p>(maybe also do a quick location flipping of the access fact just in case ;)</p>
</blockquote>
<p>Doing this now :)</p>



<a name="206029339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206029339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206029339">(Aug 05 2020 at 14:35)</a>:</h4>
<p>maybe read the linked thread, you didn't remember why it was the only fact at this kind of point, but of course there could ahve been a reason, maybe discussing with matthew or niko</p>



<a name="206029428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206029428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206029428">(Aug 05 2020 at 14:36)</a>:</h4>
<p>but the case of initializing a local from a call was the issue</p>



<a name="206029456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206029456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206029456">(Aug 05 2020 at 14:36)</a>:</h4>
<p>as both init and move error were checking the same point</p>



<a name="206029482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206029482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206029482">(Aug 05 2020 at 14:36)</a>:</h4>
<p>it was an interesting case :)</p>



<a name="206029558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206029558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206029558">(Aug 05 2020 at 14:37)</a>:</h4>
<p>at least the repo contains enough different datasets to test move errors a bit, see if there are false positives or not, and so on</p>



<a name="206029676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206029676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206029676">(Aug 05 2020 at 14:38)</a>:</h4>
<p>Yes, but I remember spending a lot of time thinking about that. It might have been a mistake though; I'll compare it to what I wrote in my thesis</p>



<a name="206029737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206029737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206029737">(Aug 05 2020 at 14:38)</a>:</h4>
<p>but yeah, maybe we do need to flip it back where it used to be :) (the new issue with temporaries + drop is also interesting)</p>



<a name="206029757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206029757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206029757">(Aug 05 2020 at 14:38)</a>:</h4>
<p>I mean, just because I thought hard about it doesn't mean I didn't butter-finger that particular line in Rust</p>



<a name="206029798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206029798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206029798">(Aug 05 2020 at 14:39)</a>:</h4>
<p>yeah it could be a simple typo</p>



<a name="206029884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206029884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206029884">(Aug 05 2020 at 14:39)</a>:</h4>
<p>Also, specifically open/closed intervals is something I frequently struggle with, so I might have just messed it up</p>



<a name="206029962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206029962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206029962">(Aug 05 2020 at 14:40)</a>:</h4>
<p>We'll know when the tests finish I guess</p>



<a name="206030019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206030019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206030019">(Aug 05 2020 at 14:40)</a>:</h4>
<p>I myself don't remember if you had talked about this specific case of initializing with calls with <span class="user-mention" data-user-id="116009">@nikomatsakis</span> when you were coming up with the rules</p>



<a name="206030085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206030085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206030085">(Aug 05 2020 at 14:41)</a>:</h4>
<p>as it seemed move errors really did detect errors along an edge, while this seemed to be at a specific point ?</p>



<a name="206030410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206030410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206030410">(Aug 05 2020 at 14:43)</a>:</h4>
<p>as this could have been fixed two ways:</p>
<ul>
<li>moving one of the colliding facts, and have the existing rules detect the error, as it'd now be on an edge -- which is what I did</li>
<li>change the rules</li>
</ul>



<a name="206030665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206030665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206030665">(Aug 05 2020 at 14:45)</a>:</h4>
<p>I have <a href="https://hackmd.io/@albins/Byh_rBOZv">some related lab notes</a> (so happy I kept those), but that seems to be mainly about emitting initialisation facts</p>



<a name="206030796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206030796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206030796">(Aug 05 2020 at 14:46)</a>:</h4>
<p>For function arguments, that is</p>



<a name="206036038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206036038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206036038">(Aug 05 2020 at 15:23)</a>:</h4>
<p>are we discussing the "false positive" case?</p>



<a name="206036415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206036415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206036415">(Aug 05 2020 at 15:26)</a>:</h4>
<p>its cause yeah</p>



<a name="206036481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206036481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206036481">(Aug 05 2020 at 15:26)</a>:</h4>
<p>the false positive fix which ended up creating that other issue</p>



<a name="206036513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206036513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206036513">(Aug 05 2020 at 15:27)</a>:</h4>
<p>in case it also impacts the move errors Albin is seeing now on rustc tests</p>



<a name="206037138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206037138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206037138">(Aug 05 2020 at 15:31)</a>:</h4>
<p>It seems to, because I don't think I see nearly as many failures when I switched back mid/start points for fact emission, but for whatever reason the test script has been stuck on if-expr-stack-overflow for a long time now</p>



<a name="206037153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206037153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206037153">(Aug 05 2020 at 15:31)</a>:</h4>
<p>I'm considering killing it</p>



<a name="206037281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206037281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206037281">(Aug 05 2020 at 15:32)</a>:</h4>
<p>Ok, that seems to have worked in the sense that the test terminated. I now have...different errors, so there is clearly an interaction going on</p>



<a name="206037514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206037514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206037514">(Aug 05 2020 at 15:34)</a>:</h4>
<p>Ok that didn't solve it anyway, so I'd have to investigate this further</p>



<a name="206037607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206037607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206037607">(Aug 05 2020 at 15:35)</a>:</h4>
<p>if I wanted to examine the failure,</p>



<a name="206037624"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206037624" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206037624">(Aug 05 2020 at 15:35)</a>:</h4>
<p>how would I do so :)</p>



<a name="206037632"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206037632" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206037632">(Aug 05 2020 at 15:35)</a>:</h4>
<p>should I use <span class="user-mention" data-user-id="204115">@Albin Stjerna</span>'s branch?</p>



<a name="206037641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206037641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206037641">(Aug 05 2020 at 15:35)</a>:</h4>
<p>(is it published somewhere..?)</p>



<a name="206037652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206037652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206037652">(Aug 05 2020 at 15:35)</a>:</h4>
<p>also, remind me which test it is etc</p>



<a name="206037672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206037672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206037672">(Aug 05 2020 at 15:35)</a>:</h4>
<p>Yes, you can more or less check out my branch and run one of the failing tests</p>



<a name="206037745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206037745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206037745">(Aug 05 2020 at 15:36)</a>:</h4>
<p>what test are you trying btw ?</p>



<a name="206037751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206037751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206037751">(Aug 05 2020 at 15:36)</a>:</h4>
<p>branch is <a href="https://github.com/albins/rust">https://github.com/albins/rust</a></p>



<a name="206037900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206037900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206037900">(Aug 05 2020 at 15:37)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116113">lqd</span> <a href="#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/move.20error.20reporting/near/206037745">said</a>:</p>
<blockquote>
<p>what test are you trying btw ?</p>
</blockquote>
<p>All of them, I guess? I'm running <code>./x.py test -i --stage 1 --compare-mode polonius src/test/ui --bless</code></p>



<a name="206038001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206038001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206038001">(Aug 05 2020 at 15:38)</a>:</h4>
<p>One example of a failing test is <code>async-await/multiple-lifetimes/hrtb.rs</code></p>



<a name="206038181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206038181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206038181">(Aug 05 2020 at 15:39)</a>:</h4>
<p>(that one specifically works fine if I reverse @lqd's changes and emit <code>path_accessed_at_base</code> at the start-point rather than mid-point)</p>



<a name="206038470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206038470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206038470">(Aug 05 2020 at 15:42)</a>:</h4>
<p>I haven't verified this, but I see very little overlap in which files error</p>



<a name="206038520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206038520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanda Stjerna <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206038520">(Aug 05 2020 at 15:42)</a>:</h4>
<p>Which sort of gives me the feeling that the move errors are "almost correct"</p>



<a name="206137844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206137844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206137844">(Aug 06 2020 at 13:07)</a>:</h4>
<p>ah actually I should mention this</p>



<a name="206138286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206138286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206138286">(Aug 06 2020 at 13:11)</a>:</h4>
<p>the false positive fix didn't just remove the unexpected errors in the polonius repo on code that should work, it also made polonius match NLLs again on 2 of the rustc tests related to move/init analysis we talked about at the time: <a href="https://github.com/rust-lang/rust/blob/be5fe051a843cfbbc1ba4fcd347b641417181b8f/src/test/ui/nll/maybe-initialized-drop-implicit-fragment-drop.rs">maybe-initialized-drop-implicit-fragment-drops</a><br>
and <a href="https://github.com/rust-lang/rust/blob/2a663555ddf36f6b041445894a8c175cd1bc718c/src/test/ui/nll/maybe-initialized-drop-with-uninitialized-fragments.rs">maybe-initialized-drop-with-uninitialized-fragments</a></p>



<a name="206138611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206138611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206138611">(Aug 06 2020 at 13:14)</a>:</h4>
<p>my understanding is that they started to compile because of the changes in fact generation done to support move errors; we ultimately want them to compile; and they can be close to the "spurious issue"</p>



<a name="206181422"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/186049-t-compiler/wg-polonius/topic/move%20error%20reporting/near/206181422" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/186049-t-compiler/wg-polonius/topic/move.20error.20reporting.html#206181422">(Aug 06 2020 at 18:48)</a>:</h4>
<p>alright <a href="https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-74564-if-expr-stack-overflow.rs">this rustc test</a> will be interesting to try with the new move errors rules implementation, as the current one either doesn't complete or OOM I'm not sure (both <code>var_maybe_partly_initialized_on_exit</code> and <code>move_error</code> relations exhibit this issue)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>